<template>
  <div style="border: 1px solid">
    <p>test2</p>
    <p>businessKey:{{ props.businessKey }}</p>
    <p>instanceId:{{ props.instanceId }}</p>
    <p>taskId:{{ props.taskId }}</p>
<!--    <el-divider></el-divider>-->
<!--    <assigner-select  title="下一审批节点指定审批人员类型(若不指定的话，流转到对应节点已配置的人员身上)"-->
<!--                      ref="assigner" :otherConfig="{actorWay: 1,actorWayType: 1,orgScope: 1,roleScope: 1}"></assigner-select>-->
<!--    <el-button-->
<!--        type="primary"-->
<!--        icon="el-icon-plus"-->
<!--        round-->
<!--        @click="getActorTypeData"-->
<!--    >获取人员数据</el-button-->
<!--    >-->
  </div>
</template>
<script lang="ts" setup name="test2">
import {
  defineAsyncComponent,
  ref,
  reactive,
  onMounted,
  nextTick,
  computed,
  watch,
} from "vue";
import assignerSelect from '@/views/system/workflow/flowTask/component/small/assignerSelect.vue'
interface ActorTypeData {
  setType: Number;//1 指定人员,3 指定角色,8 指定组织
  examineMode: Number;//1 顺签,2 会签,3 或签
  nodeUserListScope?: Array<{
    id: string,//userId
    name: string//userName
  }>;
  nodeRoleListScope?: Array<{
    id: string,//roleId
    name: string//roleName
  }>;
  nodeOrgListScope?: Array<{
    id: string,//orgId
    name: string//orgName
  }>;
}

const assigner = ref(null);
const emits = defineEmits(['changeActorType','getActorListForFunction']);
const props = defineProps(  {
  businessKey: {
    type: String,
    required: true,
  },
  instanceId: {
    type: String,
    required: true,
  },
  taskId: {
    type: String,
    required: true,
  },
})
const getData = ()=>{
  return {test2: {title: 'test2'}}
}
const getActorTypeData = ()=> {
  const nodeConfig :ActorTypeData = assigner.value?.getData();
  emits('changeActorType',nodeConfig);
}

onMounted(() => {
  const nodeConfig :ActorTypeData = {
    setType: 1,
    examineMode: 1,
    nodeUserListScope: [{
      id: "56983f06019947828053b27298362eb7",
      name: "test4"
    },{
      id: "03e6b518592e4088b49c907705966878",
      name: "test1"
    },{
      id: "98720568b5b04a628cd51ee5414a53cd",
      name: "test7"
    }]
  };
  // emits('getActorListForFunction',nodeConfig);
  $api.common.send
      .post('flowLong019', {})
      .then((res) => {
        emits('getActorListForFunction',res.result);
      })
      .catch(() => {});
});

defineExpose({
  getData
})

</script>
